import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:imperius_insights/treaty/dimensions.dart';
import 'package:imperius_insights/treaty/palette.dart';
import 'package:imperius_insights/treaty/styles.dart';
import 'package:url_launcher/url_launcher.dart';

class PeddleBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      padding: EdgeInsets.all(1),
      child: Material(
        elevation: 2,
        borderRadius: BorderRadius.circular(layoutDimensions.radiusCard),
        shadowColor: Colors.grey,
        color: Colors.white,
        child: InkWell(
            onTap: () => launch('https://rankqr.com/imperius'),
            child: Row(
              children: <Widget>[
                Image.network(
                  'https://s.qunarzz.com/flight_additional_bundle/images/imperius/logo_classic.png',
                  height: 45,
                ),
                Expanded(
                  child: Container(
                    padding: EdgeInsets.all(3),
                    child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          Text('点击下载Imperius移动版',
                              style: styles.titleSecondary),
                          Text(
                              '⚠️ 当前alpha阶段仅用于评估测试，数据准确性以JIRA和TODO为准。',
                              style: styles.contentTipGray)
                        ]),
                  ),
                ),
                Container(
                  margin: EdgeInsets.all(10),
                  child: Icon(Icons.cloud_download,
                      color: palette.theme, size: 32),
                )
              ],
            )),
      ),
    );
  }
}
